/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fasea.ui;

import fasea.model.Action;
import fasea.model.FaseaModel;
import java.util.Observable;
import java.util.Observer;

/**
 *
 * @author lars-wolfram
 */
public abstract class AbstractController<T> implements Observer {

    protected FaseaModel model;
    protected  T view;

    public void bindModel(FaseaModel model) {
        this.model = model;
        this.model.addObserver(this);
    }
    
    public void bindView(T view) {
        this.view = view;
        initView();
    }

    public void update(Observable beobachtbarer, Object action) {
        update((Action)action);
    }
    
    public abstract void update(Action action);
    
    protected abstract void initView();
    
}
